FlowViz

FlowViz

function
FlowViz()

Option name Type Description
config String The relative path to a JSON file containing the FlowViz configuration information
selector String A CSS-style selector for the SVG tag in which the visualization should be generated

The main class of the FlowViz library. This module is responsible for tying together all of the other modules of the
library

function FlowViz(app, config, selector){
    var that = this;

    this.DebugMode = false;

    this.App = app;
    this.Legend = null;
    this.Renderer = null;
    this.Selector = selector;

    this.FlowEdge = FlowEdge;
    this.FlowNode = FlowNode;

    FlowNode.SetFvRef(this);
    FlowEdge.SetFvRef(this);

    this.Config = new ConfigParser(config, app, this);
    this.on('config-ready', function() {
        // Create module objects
        that.Interactions = new Interactions(that);
        that.Selection = new Selection(that);
        that.Layout = new Layout(that);
        that.Renderer = new Renderer(that);
        that.ConstraintChecker = new ConstraintChecker(that);
        that.GraphManager = new GraphManager(that);

        // Initialize AddOns
        that.Notify = new Notify(that);
        that.Controls = new Controls(that);
        that.Legend = new Legend(that);
        that.DataEditor = new DataEditor(that);

        // Run the first rendering
        that.Renderer.Update();


        // Signal that we are ready to go
        that.emit('flowviz-ready');
    });
    this.on('config-error', function(msg) {
        that.ShowError(msg, -1);
    })
}

HasEvent

method
FlowViz.prototype.HasEvent() ->boolean

Option name Type Description
evt String The name of an event (e.g. 'ready')

Checks to see if a given event is in the list of events that this module emits

FlowViz.prototype.HasEvent = function(evt) {
    return $.inArray(evt, events) >= 0;
};

ShowMessage

method
FlowViz.prototype.ShowMessage()

Option name Type Description
msg string Message to show
duration number How long to show the message

Shows a standard status message in the interface.

FlowViz.prototype.ShowMessage = function(msg, duration) {
    if(duration === undefined) {
        duration = Notify.NORMAL;
    }

    this.emit('notify-std', msg, duration);
};

ShowWarning

method
FlowViz.prototype.ShowWarning()

Option name Type Description
msg string Message to show
duration number How long to show the message

Shows a warning message in the interface.

FlowViz.prototype.ShowWarning = function(msg, duration) {
    if(duration === undefined) {
        duration = Notify.LONG;
    }

    this.emit('notify-warn', msg, duration);
};

ShowError

method
FlowViz.prototype.ShowError()

Option name Type Description
msg string Message to show
duration number How long to show the message

Shows an error message in the interface.

FlowViz.prototype.ShowError = function(msg, duration) {
    if(duration === undefined) {
        duration = Notify.LONG;
    }

    this.emit('notify-error', msg, duration);
};